<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

    class Company_finance_info_model extends MY_Model
    {
        public function __construct() 
        {
            parent::__construct();
            $this->tbl_name = 'finance_infos';
        }
        
        public function getAllFinanceInfo($company_id,$start,$per_page)
        {
            $sql = "SELECT *
                    FROM  finance_infos 
                    WHERE active = 1 AND companies_id = $company_id
                    ORDER BY id DESC
                    LIMIT $start, $per_page";
                        
            $query = $this->db->query($sql);

            $data = array();
            if ($query->num_rows() > 0)
            {
               foreach ($query->result_array() as $row)
               {
                    $data[] = $row;    
               }
               return $data;
            } 
        }        
    }
?>
